# Basado en siPYgames

import pygame, sys, os, random, math,  Utilities,  MainMenu,  Game
from pygame.locals import *
from Utilities import *

# Definicion de constantes del programa
SCREENWIDTH = 1200
SCREENHEIGHT = 750
SCREENSIZE = Rect(0, 0, SCREENWIDTH, SCREENHEIGHT)

class Main():
    
    def __init__(self):
        
        pygame.mixer.pre_init(44100,  -16,  2,  1024)
        # Se inicializa la pygame
        pygame.init()
       
        # Inicializacion de la pantalla del juego
        self.screen = pygame.display.set_mode(SCREENSIZE.size)
        pygame.display.set_caption('Obligatorio de Linux')
    
    def _main(self):
        while True:
            MainMenu.display(self.screen)
            action = MainMenu.handle(self.screen)
            if action == "PLAY":
                Game.main(self.screen)                    
            else:
                sys.exit()

if __name__ == "__main__":
    MainWindow = Main()
    MainWindow._main()
